<template>
  <div class="collect">
    <common-nav :single="single"></common-nav>
    <div class="standard-container">
         <skin-index :skinValue="skinValue"></skin-index>
    </div>
  </div>
</template>
<script lang="ts">
  import Vue from 'vue'
  import Component from 'vue-class-component'
  import CommonNav from '../../components/common/common-nav'
  import SkinIndex from '../../components/my/skin-index'
  import {State} from "vuex-class";
  import {Actions, Store} from "../../enums/Store";
  import {SkinInterface} from "../../interfaces/PageInterface";
  @Component({
    components:{
      CommonNav,
      SkinIndex
    }
  })
  export default class Skin extends Vue {
    private single='切换主题'
    @State(Store.Skin) skinValue:SkinInterface[Store.Skin]

    private created(){
      if(process.browser){
        if(localStorage.getItem('themesBg')){
          this.$store.dispatch(Actions.GetSkin,localStorage.getItem('themesBg'))
        }else{
          this.$store.dispatch(Actions.GetSkin,'0')
        }
      }

    }

  }
</script>
